<template>
	<view class="uni-container">
			<uni-table ref="table" :loading="loading" border stripe  emptyText="暂无更多数据" >
				<uni-tr>
					<uni-th	align="center">推荐期数</uni-th>
					<uni-th	align="center">彩种</uni-th>
					<uni-th	align="center">项目名称</uni-th>
					<uni-th	align="center">内容</uni-th>
					<uni-th	align="center">佣金选项</uni-th>
				</uni-tr>
				<uni-tr v-for="(item, index) in tableData" :key="index">
					<uni-td align="center">{{ item.lotteryNo }}</uni-td>
					<uni-td align="center">{{ lotteryType[item.lotteryTypeIndex] }}</uni-td>
					<uni-td align="center">{{ getProjectNameByIndex(item.projectNameIndex) }}</uni-td>
					<uni-td align="center">{{ item.numbers }}</uni-td>
					<uni-td align="center">{{ item.commission }}</uni-td>
				</uni-tr>
			</uni-table>
	</view>
</template>
<script>
export default {
	data() {
		return {
			loading: false,
			tableData:[],
			projectNames: [
					{
						projectName:[{name:"大底700+",id:"1"},{name:"五码胆出123",id:"11"},{name:"百十差排除3个号码",id:"21"},]
					},
					{
						projectName:[{name:"大底600+",id:"2"},{name:"四码胆出123",id:"12"},{name:"百个差排除3个号码",id:"22"},]
					},
					{
						projectName:[{name:"大底500+",id:"3"},{name:"三码胆出123",id:"13"},{name:"十个差排除3个号码",id:"23"},]
					},
					{
						projectName:[{name:"大底400+",id:"4"},{name:"任意7码出23",id:"14"},{name:"百十和排除3个号码",id:"24"},]
					},
					{
						projectName:[{name:"大底300+",id:"5"},{name:"百位排除3码",id:"15"},{name:"百个和排除3个号码",id:"25"},]
					},
					{
						projectName:[{name:"大底200+",id:"6"},{name:"十位排除3码",id:"16"},{name:"十个和排除3个号码",id:"26"},]
					},
					{
						projectName:[{name:"大底100+",id:"7"},{name:"个位排除3码",id:"17"},{name:"任意选3个差",id:"27"},]
					},
					{
						projectName:[{name:"精选50注",id:"8"},{name:"排除3个和尾",id:"18"},{name:"任意选3个和",id:"28"},]
					},
					{
						projectName:[{name:"精选10注",id:"9"},{name:"排除6个两码",id:"19"},{name:"百十个排除2x2x2",id:"29"},]
					},
					{
						projectName:[{name:"排除任意2个号码",id:"20"}]
					}
			],
			lotteryType: ['排三推荐','3D推荐'], 
		};
	},
	onLoad() {
		this.getTableData()
	},
	methods: {
		getProjectNameByIndex(index){
			let name = ""
			this.projectNames.forEach(item =>{
				item.projectName.forEach(obj => {
					if(index == obj.id ){
						name = obj.name
						return 
					}
				})
			})
			return name
		},
		getTableData(){
			this.$myRequest({
			  	method: 'get',
			  	url: '/submit/getMySubmitRecord'
			  }).then((res) => {
				  if(res.flag){
					   this.tableData = res.data
				  }
			})
		}
	}
};
</script>

<style scoped>
.uni-container {
	
 
}
</style>
